﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using eCommerce.Core.Domain.Products;

namespace eCommerce.Data.Mapping.Products
{
    public class ItemMapping : EntityTypeConfiguration<Item>
    {

         public ItemMapping()
        {
            this.ToTable("Items");
            this.HasKey(p => p.Id);


             this.HasOptional(c => c.ProductAttributeValue);
             this.HasOptional(c => c.ItemAttributeValue);

             //this.HasRequired(s => s.Product).WithMany(c => c.Items)
             //    .HasForeignKey(o => o.ProductId).WillCascadeOnDelete(false);
        }
    }
}
